package com.sbhotel.chotellauncher.util;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.sbhotel.chotellauncher.R;
import com.youth.banner.loader.ImageLoader;

public class GlideImageLoader extends ImageLoader {
    @Override
    public void displayImage(Context context, Object path, ImageView imageView) {
        //Glide.with(context).load((int)path).into(imageView);
        if(path instanceof Integer) {
            imageView.setImageResource((int) path);
        } else if(path instanceof String) {
            Glide.with(context).load((String)path)
                    .apply(RequestOptions.placeholderOf(R.mipmap.ad1).error(R.mipmap.ad1))
                    .into(imageView);
        }
    }
}
